﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Pawn
{
    public partial class FrmDangNhap : Form
    {
        public String MatKhau { get { return tbMatKhau.Text; } }
        public FrmDangNhap()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DataClassesDataContext db = new DataClassesDataContext();
            var q = from c in db.CaiDats
                    select c;
            foreach (var cd in q)
            {
                if (cd.MatKhau == MatKhau)
                {
                    DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Mật khẩu không đúng!", "Thông Tin", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
